import { SetMetadata,createParamDecorator,ExecutionContext ,applyDecorators } from '@nestjs/common';
import type {Request} from 'express';

export const Role = (role: string[]) => {
    console.log('role =>', role)
    return SetMetadata('role', role);
}

// 自定义参数装饰器返回一个url
export const ReqUrl = createParamDecorator((data:string,ctx:ExecutionContext)=>{
    const req = ctx.switchToHttp().getRequest<Request>()
    return req.url
})
